/*
 * Copyright (C) Michael Opitz
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
 * USA
 */
#ifndef LIGHT_H
#define LIGHT_H

#include <stdlib.h>
#include <stdio.h>

/**
 * This struct holds the light-data.
 */
typedef struct light_t {
	uint16_t _lux;
} light;

/**
 * Allocates a light-object
 */
light* light_alloc(uint16_t lux);
/**
 * Frees a light-object
 */
void light_free(light *l);

/**
 * Calculates which pins you must set to high, with a fuzzy algorithm.
 * \return The insensity from 0 to 7 is returned. (0 = very bright light)
 */
uint8_t light_calc(light *l);

#endif
